<?php
namespace App\Repositories\Main;

use App\Models\Main\MsgGroupStaffsModel;
use App\Repositories\BaseRepository;

class MsgGroupStaffsRepository extends BaseRepository
{
    protected $repository;

    public function __construct()
    {
        $this->repository = new MsgGroupStaffsModel();
    }

//    public function getIndexList(){
//        return $this->repository
//            ->orderBy('id','asc')
//            ->skip(0)
//            ->take(10)
//            ->get();
//    }

    public function getIndexByGroup($group){
        return $this->repository
            ->where('group',$group)
            ->where('del',0)
            ->orderBy('id','asc')
            ->get();
    }

    public function setAdd($data)
    {
        $data['created_at'] = time();
        return $this->repository->insertGetId($data);
    }

//    public function getShowOne($id)
//    {
//        return $this->repository->where('id',$id)->first();
//    }
}